BINDING_NAME_CHATLATER = "ChatLater";

local lastEditboxText = "";

-- Open or hide the last chatbox
local function ChatLater_HideLastChat(editbox)
	if (editbox:IsShown()) then 
		lastEditboxText = editbox:GetText();
		editbox:SetText("");
	end
end

-- Hook the blizzard's ChatEdit_OnEnterPressed in ChatFrame.lua
local Orig_ChatEdit_OnEnterPressed = ChatEdit_OnEnterPressed;

function ChatEdit_OnEnterPressed(self,...)
	if (IsShiftKeyDown()) then
		ChatLater_HideLastChat(self,...);
	end
	return Orig_ChatEdit_OnEnterPressed(self,...);
end

--
function ChatLater_OpenLastChat()
	if (lastEditboxText) then
		ChatFrame_OpenChat(lastEditboxText);
	end
end